public class StringBuilderDemo {
    public static void  main(String[] args){
        StringBuilderDemo str = new StringBuilderDemo();
        str.test();
    }

    public  void test(){
        //使用StringBuilder时首先要创建StringBuilder实例
        StringBuilder StringBuilder = new StringBuilder();
        //hello word
        //StringBuilder 通过To String () 方法获取最终得拼接好得字符串
        StringBuilder.append("h").append("e").append("llo").append("word");
        //StringBuilder 通过To String () 方法获取最终得拼接好得字符串
        String str = StringBuilder.toString();
        System.out.println(str);
        StringBuilder.insert(3,"ll");
        System.out.println(StringBuilder.toString());
    }

}
